/**
 * @Author 韦建韩
 * @Date 2022/3/24
 */
package com.zczn.order_system.entity.pojo;

import com.zczn.order_system.constant.HttpCodeConstant;
import com.zczn.order_system.entity.dto.ResultDto;
import lombok.Data;

import java.util.List;
import java.util.Map;
@Data
public class Result {
    private Integer code;
    private Object data;
    private List<Object> dataList;
    private Map<Object,Object> dataMap;
    public Result(){
        this.code = HttpCodeConstant.Field.Success.code;
    }
    public void convertDto(ResultDto resultDto){
        code = resultDto.getCode();
        data = resultDto.getData();
        dataList = resultDto.getDataList();
        dataMap = resultDto.getDataMap();
    }
    public static Result doCreate(){
        return new Result();
    }
}
